import axios from '@/common/plugins/Axios'

export default {
    // 机器人任务列表，可分页查询
    queryTaskByMul: (taskName: String, platCode: String, size: number, page: number) => {
        return axios.request({
            url: `/robotManage/getRobotList`,
            method: 'get',
            params: {
                taskName: taskName,
                platCode: platCode,
                size: size,
                page: page
            }
        })
    },
    // 机器人任务注册
    registerTask: (task) => {
        return axios.request({
            url: `/robotManage/robotRegister`,
            method: 'put',
            data: task
        })
    },
    // 机器人任务更改
    updateTask: (task) => {
        return axios.request({
            url: `/robotManage/robotUpdate`,
            method: 'post',
            data: task
        })
    },
    // 机器人任务注销
    deleteTask: (taskId: String) => {
        return axios.request({
            url: `/robotManage/robotOffline`,
            method: 'post',
            data: { taskId }
        })
    },
    // 获取可选平台
    getRobotPlatList: () => {
        return axios.request({
            url: `/robotManage/getRobotPlatList`,
            method: 'get',
        })
    }
}
